package com.zx.idc.backend.gui.scheduler.ins.filtermonitorlog.job;

import com.zx.idc.backend.gui.scheduler.ins.filtermonitorlog.job.base.BaseFilterAndMonitorInstructionJob;
import com.zx.idc.ds.sys.service.ISysGlobalStatusService;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 定时根据指令ID清除缓存(目前只包含过滤/监测指令)
 */
@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class InsCleanCacheJob extends BaseFilterAndMonitorInstructionJob implements Job {

    private static final Logger LOG = LoggerFactory.getLogger(InsCleanCacheJob.class);

    @Autowired
    private ISysGlobalStatusService iSysGlobalStatusService;



    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            LOG.info("定时根据域名清除关键字/文本缓存Job开始执行");
            iSysGlobalStatusService.insCacheClean();
            LOG.info("定时根据域名清除关键字/文本缓存Job开始完成");
        } catch (Exception e) {
            LOG.error("清除关键字/文本缓存Job 异常", e);
        }
    }


}
